﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using SqlSugar;

namespace OfficialWeb.Core
{
    public class BaseClass
    {
    }

    /// <summary>
    /// 主键
    /// </summary>
    public class IdBase
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }
    }

    /// <summary>
    /// (创建人+修改人)(int类型，用于存放Id,String类型，用户存放名称)+创建日期+修改日期
    /// </summary>
    public class UserBase<T>
    {
        /// <summary>
        /// 创建人
        /// </summary>
        [SugarColumn(ColumnName = "create_user")]
        public T CreateUser { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        [SugarColumn(ColumnName = "update_user")]
        public T UpdateUser { get; set; }
        /// <summary>
        /// 创建日期
        /// </summary>
        [SugarColumn(ColumnName = "create_date")]
        public DateTime CreateDate { get; set; }
        /// <summary>
        /// 修改日期
        /// </summary>
        [SugarColumn(ColumnName = "update_date")]
        public DateTime UpdateDate { get; set; }
    }

    /// <summary>
    /// 排序
    /// </summary>
    public class SortBase
    {
        /// <summary>
        /// 排序
        /// </summary>
        [SugarColumn(ColumnName = "sort")]
        public int Sort { get; set; }
    }

    /// <summary>
    /// 删除
    /// </summary>
    public class IsDeletedBase
    {
        /// <summary>
        /// 删除位：是否删除
        /// </summary>
        [SugarColumn(ColumnName = "is_deleted")]
        public bool IsDeleted { get; set; }
    }

    /// <summary>
    /// 主键+创建人(int)+修改人(int)+创建日期+修改日期
    /// </summary>
    public class IdAndUserIntBase: UserBase<int>
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }
    }

    /// <summary>
    /// 主键+创建人(String)+修改人(String)+创建日期+修改日期
    /// </summary>
    public class IdAndUserStringBase: UserBase<String>
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }
    }

    /// <summary>
    /// 主键+创建人(int)+修改人(int)+创建日期+修改日期+删除
    /// </summary>
    public class IdAndUserIntAndIsDeletedBase : IdAndUserIntBase
    {
        /// <summary>
        /// 删除位：是否删除
        /// </summary>
        [SugarColumn(ColumnName = "is_deleted")]
        public bool IsDeleted { get; set; }
    }

    /// <summary>
    /// 主键+创建人(String)+修改人(String)+创建日期+修改日期+删除
    /// </summary>
    public class IdAndUserStringAndIsDeletedBase : IdAndUserStringBase
    {
        /// <summary>
        /// 删除位：是否删除
        /// </summary>
        [SugarColumn(ColumnName = "is_deleted")]
        public bool IsDeleted { get; set; }
    }

    /// <summary>
    /// 主键+删除
    /// </summary>
    public class IdAndIsDeletedBase: IdBase
    {
        /// <summary>
        /// 删除位：是否删除
        /// </summary>
        [SugarColumn(ColumnName = "is_deleted")]
        public bool IsDeleted { get; set; }
    }

    /// <summary>
    /// 主键+删除+排序
    /// </summary>
    public class IdAndIsDeletedAndSortBase:IdAndIsDeletedBase
    {
        /// <summary>
        /// 排序
        /// </summary>
        [SugarColumn(ColumnName = "sort")]
        public int Sort { get; set; }
    }

    /// <summary>
    /// 主键+创建人(int)+修改人(int)+创建日期+修改日期+删除+排序
    /// </summary>
    public class IdAndIsDeletedAndSortAndUserIntBase: IdAndUserIntAndIsDeletedBase
    {
        /// <summary>
        /// 排序
        /// </summary>
        [SugarColumn(ColumnName = "sort")]
        public int Sort { get; set; }
    }

    /// <summary>
    /// 主键+创建人(String)+修改人(String)+创建日期+修改日期+删除+排序
    /// </summary>
    public class IdAndIsDeletedAndSortAndUserStringBase : IdAndUserStringAndIsDeletedBase
    {
        /// <summary>
        /// 排序
        /// </summary>
        [SugarColumn(ColumnName = "sort")]
        public int Sort { get; set; }
    }

    /// <summary>
    /// 创建日期+修改日期
    /// </summary>
    public class DateBase
    {
        /// <summary>
        /// 创建日期
        /// </summary>
        [SugarColumn(ColumnName = "create_date")]
        public DateTime CreateDate { get; set; }
        /// <summary>
        /// 修改日期
        /// </summary>
        [SugarColumn(ColumnName = "update_date")]
        public DateTime UpdateDate { get; set; }
    }

    /// <summary>
    /// 主键+创建日期+修改日期
    /// </summary>
    public class IdAndDateBase: DateBase
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }
    }

    /// <summary>
    /// 主键+创建日期+修改日期+删除
    /// </summary>
    public class IdAndDataAndIsDeletedBase: IdAndDateBase
    {
        /// <summary>
        /// 删除位：是否删除
        /// </summary>
        [SugarColumn(ColumnName = "is_deleted")]
        public bool IsDeleted { get; set; }
    }
}
